namespace java com.vng.zing.survey.thrift.model
namespace cpp  com.vng.zing.survey.thrift.model


typedef i32 IDUser
typedef i32 IDSurvey
typedef i16 IDQues
enum State{
	VIEW = 0,
	RESPONSE = 1,
	NEW = 2
}

// store list IDSurvey of IDUser
typedef IDUser IDSurveyKey
struct IDSurveyItem{
	1: list<IDSurvey> idSurveys,
	2: i32 count
}

struct Question{
	1: IDQues idQues,
	2: string titleQues,
	3: string helpText,
	4: bool require,
        5: i16 type,
	6: list<string> answers
}
typedef IDSurvey SurveyKey
struct SurveyItem{
	1: IDUser iDUser,
	2: string title,
	3: string description,
	4: list<Question> questions,
	5: i32 createdDay,
      	6: i32 beginDay,
	7: i32 endDay,
	8: i16 point,
	9: bool status,
	10: bool option
}
struct SurveyItemResult{
	1: i32 erro,
	2: SurveyItem surveyItem
}

struct ShortInfoSurveyItem{
	1: IDSurvey idSurvey,
	2: bool status,
	3: i32 view,
	4: i32 response,
	5: string title,
	6: string description
}

struct AnswerKey{
	1: IDSurvey idSurvey,
	2: IDUser idUser,
	3: IDQues idQues
}
struct AnswerItem{
	1: i16 type,
	2: IDQues idQues,
	3: string answer
}
struct Response{
       1: list<AnswerItem> answers;
       2: IDUser idUser
}
struct ResponseKey{
	1: IDSurvey idSurvey,
	2: IDUser idUser
}

typedef IDSurvey IDUserResponseKey
struct IDUserResponseItem{
      1: list<IDUser> idUsers
}

struct Result{
	1: i16 type,
	2: list<i32> number

}
typedef IDSurvey ResultSurveyKey
struct ResultSurveyItem{
	1: i32 IDUser,
	2: i32 view,
	3: i32 response,
	4: map<IDQues,Result> results,
}
struct ResultSurveyResult{
	1: i32 erro,
	2: ResultSurveyItem resultSurvey
}
